package com.atguigu.exam;

/**
 * @author xbd
 * @create 2021-05-25 22:23
 */
public class UpperTest {
    public static void main(String[] args) {
        String str = "AvfsGHcafJK";
        int count1 = 0;
        int count2 = 0;
//        char[] a1 = str.toCharArray();

        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) >= 'A' && str.charAt(i) <= 'Z'){
                count1++;
                System.out.println("大写字母为：" + str.charAt(i));
            }
        }
        System.out.println("大写字母的个数为：" + count1);

        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z'){
                count2++;
                System.out.println("小写字母为：" + str.charAt(i));
            }
        }
        System.out.println("小写字母的个数为：" + count2);
    }
}
